<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=0.5,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 设置苹果工具栏颜色 -->
    <meta name="format-detection" content="telphone=no, email=no" />
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
    <meta name="HandheldFriendly" content="true">
    <!-- 微软的老式浏览器 -->
    <meta name="MobileOptimized" content="320">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <!-- UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <!-- QQ强制全屏 -->
    <meta name="x5-fullscreen" content="true">
    <!-- UC应用模式 -->
    <meta name="browsermode" content="application">
    <!-- QQ应用模式 -->
    <meta name="x5-page-mode" content="app">
    <!-- windows phone 点击无高光 -->
    <meta name="msapplication-tap-highlight" content="no">
    <title>意向单详情</title>
    <link rel="stylesheet" href="{{asset('css/reset.css')}}">
    <link rel="stylesheet" href="{{asset('css/main.css')}}">
    <link rel="stylesheet" href="{{asset('css/index.css')}}">
    <link rel="stylesheet" href="{{asset('css/LCalendar.css')}}">
    <link rel="stylesheet" href="{{asset('css/yd_rl.css')}}" />
</head>
<body>
    <!-- 公共头部 -->
    <div class="g2_head-bg">
        <!-- 返回上一层 -->
        <p class="g2_head_goback-bg fl">
            <a href="{{url('order')}}">
                <img src="{{asset('images/xky_icon0-1.png')}}" class="g2_head_goback_icon fl" alt="">
                <span class="g2_head_goback_del fl">返回</span>
            </a>
        </p>
        <p class="ym-tit fl">意向单跟单记录</p>
        <span class="g2_head_goback_del fr khxz_color">新增</span>
        <span class="g2_head_goback_del fr gdlb_sx">筛选</span>
        <div class="cl"></div>
    </div>
    <div class="g2_head-bg2"></div>
    
    <!-- 工单（意向单）跟单记录 -->
    <!-- 跟单记录列表 -->
    <ul class="yxd_list-bg">
        @foreach($list as $vo)
        <li class="yxd_list">
            <p class="yxd_list_khname fl">{{$vo->user_id}}</p>
            <p class="yxd_list_khgdzt fl">
                <span class="yxd_khwgdzt">{{$vo->statue}}</span>
            </p>
            <p class="yxd_list_khgdtimer fr">{{$vo->date}}}</p>
            <div class="cl"></div>
            @if($vo->statue==2)
            <p class="yxd_list_khbzx2">
                <span>备注信息：</span>
                <span style="font-size:1.8rem;">
                     {{$vo->content}}
                </span>
            </p>
            @endif
        </li>
        @endforeach
        <!-- 确定跟单时间 -->
        <div class="yxd_qdgdtime">
            <form action="" id="formgendan">
                <p class="grzx_xgname yxd_gdbztit fl">跟单时间</p>
                <p class="grzx_xgname_del grzx_xgsjhm-bg fl">
                    <input type="hidden" name="user_id" value="{{$user_id}}">
                    <input type="hidden" name="order_id" value="{{$order_id}}">
                    <input type="text" name="date" id="start_date" class="start_date3" placeholder="请选择跟单时间" style="width:40%;margin-top:4.3vw;margin-right:32%;text-align:center;height:6vw !important;"
                                readonly="readonly" />
                </p>
                <div class="cl"></div>
                <!-- 意向单 第二次、第三次。。的备注输入框 -->
                <!-- <p class="yxd_gdbz-bg">
                    <span class="yxd_gdbztit fl">跟单备注</span>
                    <textarea name="" id="" class="yxd_gdbzbox fl"></textarea>
                    <div class="cl"></div>
                </p> -->
                <input type="reset" class="grzx_cx_btn fl" value="撤 销">
                <input type="button" id="tijiao" class="grzx_tj_btn fr" value="提 交">
                <div class="cl"></div>
            </form>
        </div>
    </ul>
    <!-- 遮罩 -->
    <!-- loading 小圆圈 -->
    <div class="z2_loading-bg" style="width:100%;height:100%;background:rgba(255,255,255,0.6);position:fixed;;left:0;top:0;">
        <img src="{{asset('images/loading1.gif')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <!-- loadning对号 -->
    <div class="duihao" style="width:100%;height:100%;position:fixed;;left:0;top:0;display:none;">
        <img src="{{asset('images/duihao.png')}}" style="width:10%;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;" alt="">
    </div>
    <!-- 下拉框遮罩-->
    <div class="xlz2-bg" style="width:100%;height:100%;position:fixed;left:0;top:0;background:transparent;z-index:-1;"></div>
    <!-- 提示信息 -->
    <p id="tishi" style="display:none;position:fixed;left:0;right:0;top:0;bottom:0;margin:auto;width:94%;height:8vw;line-height:8vw;color:#fff;font-size:1.6rem;text-align:center;background:rgba(0,0,0,0.5);border-radius:4px;"></p>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('js/fastclick.min.js')}}"></script>
</body>
    <script src="{{asset('js/LCalendar.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/index.js')}}" type="text/javascript" charset="utf-8"></script>
    <script>
        window.onload = function (event) {
            $(".z2_loading-bg").hide();
        }
        $(function () {
            FastClick.attach(document.body);
        });
        $(function () {
             $("#tijiao").click(function(){
                if($("input[name='date']").val()==''){
                    $("#tishi").html('跟单日期必须输入');
                    $("#tishi").stop(true, true).fadeIn('fast');
                    $("#tishi").fadeOut(1500);
                }else{
                    var d = {};
                    var t = $('#formgendan').serializeArray();
                    $.each(t, function() {
                      d[this.name] = this.value;
                    });
                    var data=JSON.stringify(d);
                    $.ajax({
                        url:"{{url('chengjiao/gendantianjia')}}",
                        type:'post', 
                        async:false,    //或false,是否异步
                        data:{'_token':'{{csrf_token()}}','data':data},
                        dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
                        beforeSend:function(){
                            console.log('发送前');
                            $('.z2_loading-bg').show();
                        },
                        success:function(data){
                            if(data=="false"){
                                $('.z2_loading-bg').hide();
                                $("#tishi").html('录入失败');
                                $("#tishi").stop(true, true).fadeIn('fast');
                                $("#tishi").fadeOut(1500);
                            }else{
                                $('.z2_loading-bg').hide();
                                $('.duihao').show();
                                $('.duihao').hide(1000);
                                window.location.reload();
                            }
                        }, 
                    })
                }
            });
        });
    </script>
    <script type="text/javascript">
        var calendar = new LCalendar();
        calendar.init({
            'trigger': '#start_date', //标签id
            'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
            'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
            'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
        });

        var calendar = new LCalendar();
        calendar.init({
            'trigger': '#end_date', //标签id
            'type': 'date', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
            'minDate': (new Date().getFullYear() - 3) + '-' + 1 + '-' + 1, //最小日期
            'maxDate': (new Date().getFullYear() + 3) + '-' + 12 + '-' + 31 //最大日期
        });
        $('.date_btn').click(function () {
            alert(111);
            $('.grzx_xgdate').css('display', 'block');
        })
        
    </script>
</html>